/**
 * @param {number[]} A
 * @param {number[]} B
 * @param {number[]} C
 * @return {void} Do not return anything, modify C in-place instead.
 */
var hanota = function (A, B, C) {
  const move = (n, from, buffer, to) => { // 移动n层汉诺塔
    if (n === 1) {
      to.push(from.pop());
    } else {
      move(n - 1, from, to, buffer);
      move(1, from, buffer, to);
      move(n - 1, buffer, from, to);
    }
  }
  move(A.length, A, B, C);
};